﻿/***************************************************************************
 *		ElGee Google Chart API Helper
 *		Copyright(C) 2011 by Laurent Geffroy lgeffroy@gmail.com
 * 
 *		This program is free software; you can redistribute it and/or 
 *		modify it under the terms of the GNU General Public License as
 *		published by the Free Software Foundation; either version 2 of 
 *		the License, or (at your option) any later version.
 *		
 *		This program is distributed WITHOUT ANY WARRANTY; without even the
 *		implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *		See the GNU General Public License for more details.
 *	
 *      For particular licensing, please contact me at lgeffroy@gmail.com
 *****************************************************************************/


using System;
using System.Runtime.Serialization;

namespace ElGee.Google.Charts
{
    /// <summary>
    /// Geo Map DataSource Class
    /// </summary>
    [DataContract]
    public class GeoMapDataSource : ExternalChartDataSourceBase
    {
        /// <summary>
        /// Gets the javascript chart options.
        /// </summary>
        /// <value>The javascript chart options.</value>
        [DataMember]
        public String JavascriptChartOptions
        {
            get
            {
                if (ChartOptions != null)
                    return ChartOptions.GetJsOptions();
                return null;
            }
            private set{}
        }

        /// <summary>
        /// Gets the chart options hask key.
        /// </summary>
        /// <value>The chart options hask key.</value>
        [DataMember]
        public String ChartOptionsHaskKey
        {
            get
            {
                if (ChartOptions != null)
                    return ChartOptions.HashKey();
                return null;
            }
            private set { }

        }
        /// <summary>
        /// Gets or sets the chart options.
        /// No DataMember because only JavascriptChartOptions and ChartOptionsHaskKey will be provided
        /// </summary>
        /// <value>The chart options.</value>
        public GeoMap ChartOptions {get; private set;}

        /// <summary>
        /// Initializes a new instance of the <see cref="GeoMapDataSource"/> class.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="chart">The Geo Map.</param>
        public GeoMapDataSource(ChartDataSource source, GeoMap chart) : base(source, "geoMap")
        {
            ChartOptions = chart;
        }
    }
}
